#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>

int main()
{
	int arr[10] = { 0,1,2,3,4,5,6,7,8,9 };
	int a[10] = {0};
	int i = 1;
	while (1)
	{
		int j = i;
		while (j)
		{
			int m = j % 10;
			a[m]++;
			if (a[m - 1] > 2020)
				goto here;
			j = j / 10;
		}
		i++;
	}
	here:
	printf("%d", i);
	return 0;
}